/**
 * VUEshop
 * ============================================================================
 * * 版权所有 2015-2027 深圳搜豹网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.vueshop.com.cn
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
 * 不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: 沈小白 2020-07-22 $
 */<template> 
	<view v-if="treamList.length>0">
		<image :src="imgUrl+'index/team.png'" mode="" class="spellgroup_title_bg"></image>
		
		<view  class="choice_box">
			<view class="choice_list">
				<block  v-for="(item,index) in treamList" :key="index" >
					<navigator :url="'/pages/goods/goodsInfo/goodsInfo?goods_id='+ item.goods_id">
						<view  v-if="index<2" class="choice_item">
							
							<!-- <image :src="hostUrl+item.original_img"></image> -->
							<image :src="hostUrl+'/mall/goods/thumb_image?goods_id='+ item.goods_id+'&width='+goodsImgWidth+'&height='+goodsImgHeight+'&'+item.goods_id+'.'+imgType"></image>
							<view class="choice_footer">
								<view class='goods_name'>{{item.goods_name}}</view>
								<!-- 暂时先隐藏 -->
								<view style='display:none;' class='pro-label'>
									<view>商品标签</view>
									<view>商品标签</view>
								</view>
								<view class="goods_name_cen">
								  <view  class='group_img'>
									 <block v-for="(item1,index) in item.team_follows" :key="index">
										 <image :src="item1.follow_user_head_pic"></image>
									 </block> 
									 
								  </view>
								  <view class="des_flex_4">
									<view class="price">￥<text>{{item.shop_price}}</text></view>
									<view class="similer">
										<text>已拼{{item.real_sale_sum}}件</text>
									</view>
								  </view>
								</view>
							</view>
						</view>
					</navigator>
					  
				</block>
				<block v-for="(item,index) in treamList" :key="item.goods_id">
					<navigator :url="'/pages/goods/goodsInfo/goodsInfo?goods_id='+ item.goods_id" >
						<view  v-if="index>=2" class="choice_item group goods_name_hot" >
							<image :src="hostUrl+'/mall/goods/thumb_image?goods_id='+ item.goods_id+'&width='+goodsImgWidth+'&height='+goodsImgHeight+'&'+item.goods_id+'.'+imgType"></image> 
							<!-- <image :src="hostUrl+item.original_img"></image> -->
							
							<view class="choice_footer">
								<view class='goods_name'>{{item.goods_name}}</view>
								<!-- 暂时先隐藏 --> 
								<view style='display:none;' class='pro-label'>
									<view>商品标签</view>
									<view>商品标签</view>
								</view>
								<view class="goods_name_cen">
								  <view  class='group_img'>
									<block v-for="(item1,index) in item.team_follows" :key="item1.follow_user_id">
										 <image :src="item1.follow_user_head_pic"></image>
									</block> 
								  </view>
								  <view class="des_flex_4">
									<view class="price">￥<text>{{item.shop_price}}</text></view>
									<view class="similer">
										<text>已拼{{item.real_sale_sum}}件</text>
									</view>
								  </view>
								</view>
							</view>
						</view>
					</navigator>
				</block>
			</view>
		</view> 
	</view>
</template>

<script>
	import {getTreamList} from "@/api/api.js";
	import config from "@/api/config.js";
	import {mapState} from 'vuex';
	export default {
		data() {
			return {
				imgUrl:config.imgUrl,
				hostUrl:config.host,//图片基础路径
				treamList:''//拼团商品列
			};
		},
		computed: {
			...mapState(['goodsImgWidth','goodsImgHeight','imgType'])
		},
		created(){
			this._getTreamList()
		},
		methods:{
			_getTreamList(){
				getTreamList().then(res=>{
					// console.log(res)
					this.treamList=res.records;
				})
			}
		}
	}
</script>
<style lang="scss" scoped >
	
	.spellgroup_title_bg{
		width: 750rpx;
		height: 80rpx;
	}
	.choice_box .choice_list .choice_item{
	    width:710rpx;
	    height: 220rpx;
	    margin:20rpx 0 0 20rpx;
	    background: $index-bg-color;
	    position: relative;
	    border-radius: 10rpx;
	    overflow: hidden;
	    display: inline-block;
	}
	.choice_box .choice_list navigator{
	    display: inline-block;
	}
	.choice_box .choice_list .inline{
	  display: inline-block;
	}
	/* 特色推荐 */
	.choice_box .choice_list_2 .choice_footer{
	  width: 490rpx;
	  height: 220rpx;
	  box-sizing: border-box;
	}
	.choice_box .choice_list .choice_item navigator{
	    display: inline-block;
	}
	.choice_box .choice_list image {
	    width: 220rpx;
	    height: 220rpx;
	}
	.choice_box .choice_list .choice_footer {
	    display: block; 
	    position: absolute;
	    line-height: 17rpx;
	    left: 220rpx;
	    top: 0;
	}
	.choice_list .choice_footer{
	    float:right;
	    width: 490rpx;
	    height:220rpx;
	    padding:14rpx 20rpx;
	    box-sizing: border-box;
	    background-color:$index-bg-color;
	    position:relative;
	}
	.choice_list_1{
	  margin-top: 20rpx;
	}
	.choice_list_2 navigator:last-child .choice_item{
	  margin-bottom: 20rpx; 
	}
	.goods_name_hot{
	  float: left;
	  width: 345rpx;
	  height: 510rpx;
	  font-size: 24rpx;
	  margin-left: 20rpx;
	  margin-bottom: 20rpx;
	  position: relative;
	  border-radius: 10rpx;
	  overflow: hidden;
	  background: $index-bg-color;
	}
	.goods_name_hot image{
	  width: 345rpx !important;
	  height: 345rpx !important;
	}
	.goods_name_hot .choice_tenct{
	  position: relative;
	  width: 100%;
	  height: 165rpx;
	}
	.goods_name_hot .choice_tenct .goods_name{
	  height: auto;
	  padding: 16rpx 24rpx 0 24rpx;
	  font-size: 26rpx;
	  line-height: 32rpx;
	  color: $text-color;
	  box-sizing: border-box;
	  overflow: hidden;
	  text-overflow: ellipsis;
	  display: -webkit-box;
	  -webkit-box-orient: vertical;
	  -webkit-line-clamp: 2;
	}
	.goods_name_hot .choice_footer .goods_name{
	  height: auto;
	  padding: 16rpx 24rpx 0 24rpx;
	  font-size: 26rpx;
	  line-height: 32rpx;
	  color:$text-color;
	  box-sizing: border-box;
	  overflow: hidden;
	  text-overflow: ellipsis;
	  display: -webkit-box;
	  -webkit-box-orient: vertical;
	  -webkit-line-clamp: 2;
	}
	.goods_name_cen{
	  position: absolute;
	  bottom: 0;
	  left: 0;
	  right: 0;
	  padding: 30rpx 20rpx 20rpx;
	  height: auto;
	  box-sizing: border-box;
	  width: 100%;
	  line-height: 32rpx;
	}
	.goods_name_cen .des_flex_4{
	  display: flex;
	  align-items: center;
	  justify-content: space-between;
	  width: 100%;
	}
	.goods_name_cen .goods_name{
	  max-width: 180rpx;
	  font-size: 28rpx;
	  font-weight: bold;
	}
	.goods_name_cen .price {
	  color: $text-color-master;
	  font-size: 22rpx;
	  font-weight: bold;
	  position: unset !important;
	}
	.goods_name_cen .price text{
	  font-size: 28rpx !important;
	}
	.goods_name_cen .similer{
	  height: auto;
	  line-height: 36rpx;
	  max-width: 180rpx;
	  font-size: 22rpx;
	  color:$text-color-hint;
	  position: unset !important;
	}
	.choice_list .choice_footer .goods_name{
	    height:auto;
	    line-height:36rpx;
	    text-align:left;
	    color:$text-color;
	    font-size:26rpx;
	    overflow:hidden;
	    text-overflow:ellipsis;
	    display: -webkit-box;
	    -webkit-box-orient:vertical;
	    -webkit-line-clamp:2;
	    box-sizing: border-box;
	}
	.choice_list .choice_footer .price {
	    color: $text-color-master;
	    font-size:22rpx;
	    font-weight:600;
	    position:absolute;
	    bottom:62rpx;
	}
	.choice_footer .price {
	    font-size: 30rpx;
	}
	.choice_list .choice_footer .similer {
	    position: absolute;
	    bottom: 10rpx;
	    text-align: center;
	    color: $text-color-hint;
	    width: fit-content;
	    line-height: 30rpx;
	    border-radius: 5rpx;
	    font-size: 22rpx;
	}
	.choice_footer .price text:nth-child(1){
	    font-size: 30rpx;
	}
	/* .choice_footer .similer text:nth-child(1){
	    margin-right: 32rpx;
	} */
	.pro-label{
	    overflow:hidden;
	    height:34rpx;
	    margin-bottom:2rpx;
	}
	.pro-label view{
	    margin-bottom: 4rpx;
	}
	/* 热销商品-商品竖直排列 */
	.vertical_type .choice_item{
	    width:360rpx !important;
	    height:500rpx !important;
	}
	.vertical_type .choice_item image{
	    width: 345rpx;
	    height: 345rpx;
	}
	.vertical_type .choice_item .choice_footer{
	    left: 0;
	    top:360rpx;
	    height:140rpx;
	    width:360rpx;
	}
	/* .vertical_type .choice_footer .goods_name {
	    -webkit-line-clamp:1;
	    height:28rpx;
	    padding:10rpx 15rpx;
	} */
	.vertical_type .choice_footer .pro-label{
	    top:56rpx;
	    left: 15rpx;
	}
	.vertical_type .choice_footer{
	    padding: 0;
	}
	.vertical_type .choice_footer .similer{
	    right: 22rpx;
	    color:$text-color-hint;
	}
	.vertical_type .choice_footer .price{
	    bottom: 16rpx;
	    left: 15rpx;
	}
	.vertical_type .similer text:nth-child(1){
	    margin-right: 0;
	}
	/* 拼团列表展示*/
	.group{
	    width:345rpx !important;
	    height:556rpx !important;
	}
	.group .image{
	    width: 345rpx !important;
	    height: 345rpx !important;
	}
	.group .choice_footer{
	    left:0 !important;
	    top:345rpx !important;
	    height:211rpx;
	    width:345rpx;
	}
	.group .choice_footer .goods_name{
	    padding: 16rpx 0rpx 0 0rpx;
	}
	.group_img{
	    /* position: absolute;
	    right: 22rpx;
	    bottom: 10rpx; */
	    width: 100%;
	    display: block;
	    margin-bottom: 10rpx;
	    height: auto;
	}
	.group_img image{
	    width: 36rpx !important;
	    height: 36rpx !important;
	    border-radius:50%;
	}
	.group_img image:nth-child(1){
	    margin-right:-6rpx;
	    border-radius:50%;
	}
	.group_image{
	    /* position: absolute;
	    right: 16rpx;
	    bottom: 50rpx; */
	    width: 100%;
	    margin-bottom: 10rpx;
	}
	.group_image image{
	    width: 36rpx !important;
	    height: 36rpx !important;
	    border-radius:50%;
	}
	.group_image image:nth-child(1){
	    margin-right:-6rpx;
	}
</style>
